/* 
 * File:   TriangleMesh.h
 * Author: brady
 *
 * Created on August 27, 2011, 3:24 AM
 */

#ifndef TRIANGLEMESH_H
#define	TRIANGLEMESH_H

#include <shapes/Triangle.h>
#include <acceleration/ShapeList.h>
#include <acceleration/IntersectionStructure.h>
#include <core/Vector3D.h>
#include <core/Vertex.h>


using namespace std;

class TriangleMesh : public Shape {
public:
    TriangleMesh();
    TriangleMesh(const TriangleMesh& orig);
    virtual ~TriangleMesh();
    bool testIntersect(IntersectionParams& ip, IntersectionResult& ir);
    void addTriangle(Vertex* v1, Vertex* v2, Vertex* v3);
    void finalize();
private:
    IntersectionStructure* triangles;
    vector<Triangle*> triangleList;
    Vector3D maxVals;
    Vector3D minVals;
};



#endif	/* TRIANGLEMESH_H */

